package org.programmers.anonymous.fightrobots;

import java.util.Enumeration;

import junit.framework.TestResult;
import junit.framework.TestSuite;

import org.programmers.anonymous.fightrobots.controller.DeffenseControllerTest;
import org.programmers.anonymous.fightrobots.controller.EmulationFightTest;
import org.programmers.anonymous.fightrobots.controller.FightControllerTest;
import org.programmers.anonymous.fightrobots.controller.MessageTest;
import org.programmers.anonymous.fightrobots.controller.RobotControllerTest;
import org.programmers.anonymous.fightrobots.controller.WeaponControllerTest;


public class Main 
{
	
	public static void main(String[] args) 
	{
		
		TestSuite tSuite = new TestSuite();
		//tSuite.addTestSuite(PersistentControllerTest.class);
		tSuite.addTestSuite(FightControllerTest.class);
		tSuite.addTestSuite(MessageTest.class);
		tSuite.addTestSuite(RobotControllerTest.class);
		tSuite.addTestSuite(DeffenseControllerTest.class);
		tSuite.addTestSuite(WeaponControllerTest.class);
		tSuite.addTestSuite(EmulationFightTest.class);

		
		TestResult tr = new TestResult();
		tSuite.run(tr);
		
		System.out.println("Errors: " + tr.errorCount());
		System.out.println("Failures: " + tr.failureCount());
		
		System.out.println("\n--ERRORS--\n");
		Enumeration<?> errors = tr.errors();
		while(errors.hasMoreElements())
		{
			Object o = errors.nextElement();
			System.out.println(o);
			System.out.println(o.getClass().getSimpleName());
		}
		
		System.out.println("\n--FAILURES--\n");
		Enumeration<?> failures = tr.failures();
		while(failures.hasMoreElements())
		{
			Object o = failures.nextElement();
			System.out.println(o);
			System.out.println(o.getClass().getSimpleName());
		}		
	}
}
